const merge = require('lodash.merge')
const config = require('kcd-scripts/jest')

module.exports = merge(config, {
  testEnvironment: 'jsdom',
  moduleFileExtensions: ['js', 'vue'],
  coverageDirectory: './coverage',
  collectCoverageFrom: ['**/src/components/**'],
  transform: {
    '^.+\\.js$': '<rootDir>/node_modules/babel-jest',
    '.*\\.(vue)$': '<rootDir>/node_modules/vue-jest',
  },
  snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
  testPathIgnorePatterns: [
    '<rootDir>/node_modules/',
  ],
  moduleNameMapper: {
    '^@/(.*)': [
      '<rootDir>/src/$1',
    ],
  },
  transformIgnorePatterns: ['node_modules/(?!(@vue/apollo-composable)/)']
})
